Global Index
HTML5 JS API Index > DOM Tutorials & Specs

CharacterData

Extends Node. Implements NonDocumentTypeChildNode, ChildNode.

Extended by Text, ProcessingInstruction, Comment

CharacterData is an abstract interface and does not exist as node. It is used by Text, Comment, and ProcessingInstruction nodes.

Properties
DOMString
data
The data attribute must return data, and on setting, must replace data with node context object offset 0, count length attribute value, and data new value.
unsigned long
length
The length attribute must return the number of code units in data.
Element?
nextElementSibling
The nextElementSibling attribute must return the first following sibling that is an element, and null otherwise.
Element?
previousElementSibling
The previousElementSibling attribute must return the first preceding sibling that is an element, and null otherwise.
Operations
voidafter((Node or DOMString) nodes...)
void
appendData(DOMString data)
The appendData(data) method must replace data with node context object, offset length attribute value, count 0, and data data.
voidbefore((Node or DOMString) nodes...)
void
deleteData(unsigned long offset, unsigned long count)
The deleteData(offset, count) method must replace data with node context object, offset offset, count count, and data the empty string.
void
insertData(unsigned long offset, DOMString data)
The insertData(offset, data) method must replace data with node context object, offset offset, count 0, and data data.
voidremove()
voidreplace((Node or DOMString) nodes...)
void
replaceData(unsigned long offset, unsigned long count, DOMString data)
The replaceData(offset, count, data) method must replace data with node context object, offset offset, count count, and data data.
DOMString
substringData(unsigned long offset, unsigned long count)
The substringData(offset, count) method must substring data with node context object, offset offset, and count count.